function printMatrix(m)
{
	var str = "";
	for(var i = 0;i < m.length;i++)
	{
		for(var j = 0;j < m[i].length;j++)
			str += m[i][j] + "\t";
		str += "\n";
	}
	console.log(str);
}

function copyLevel(array)
{
	var copy = [];
	for(var i = 0;i < array.length;i++)
	{
		copy[i] = [];
		for(var j = 0;j < array[i].length;j++)
			copy[i][j] = array[i][j];
	}
	return copy;
}